import QtQuick 1.1
//import com.nokia.symbian 1.1
import com.nokia.meego 1.0
import "platform.js" as PLATFORM
import NumismatMobile 1.0

Page {
    onStatusChanged: {
        if (status == PageStatus.Active || status == PageStatus.Activating) {
            statusBar.text = qsTr("Settings")
        }
    }

    Rectangle {
        anchors.fill: parent
        color: visual.colorBackgrond
    }

    Item {
        anchors.top: PLATFORM.TYPE == "harmattan" ? viewHeader.bottom : parent.top
        anchors.bottom: parent.bottom
        anchors.margins: visual.defaultMargin

        Column {
            spacing: 5
            anchors.margins: visual.defaultMargin

            Text {
                id: viewTitle
                text: qsTr('Filter on title works by')
                font.pixelSize: visual.fontLarge
                font.bold: true
                color: visual.colorForeground
            }

            Row {
                spacing: 5
                RadioButton {
                    id: radio1
                    checked: coinModel.view == CoinModel.CommemorativeWorld
                    onCheckedChanged: {
                        radio2.checked = !checked;
                    }
                }
                Text {
                    text: qsTr('Country')
                    font.pixelSize: visual.fontSlarge
                    color: visual.colorForeground
                    anchors.verticalCenter: parent.verticalCenter
                }
            }
            Row {
                spacing: 5
                RadioButton {
                    id: radio2
                    checked: coinModel.view == CoinModel.CommemorativeCountry
                    onCheckedChanged: {
                        radio1.checked = !checked;
                    }
                }
                Text {
                    text: qsTr('Series')
                    font.pixelSize: visual.fontSlarge
                    color: visual.colorForeground
                    anchors.verticalCenter: parent.verticalCenter
                }
            }
        }
    }

    ViewHeader {
        id: viewHeader
        clickable: false
        visible: PLATFORM.TYPE == "harmattan"
        content: Item {
            anchors.fill: parent
            Text {
                text: qsTr("Settings")
                anchors.verticalCenter: parent.verticalCenter
                width: parent.width
                elide: Text.ElideRight
                font.pixelSize: visual.fontXlarge
                color: visual.colorInvertedForeground
            }
        }
    }

    tools: ToolBarLayout {
        ToolIcon {
            platformIconId: "toolbar-back"
            onClicked: {
                if (radio1.checked)
                    coinModel.view = CoinModel.CommemorativeWorld;
                else if (radio2.checked)
                    coinModel.view = CoinModel.CommemorativeCountry;
                pageStack.pop()
            }
        }
    }
}
